<!DOCTYPE html>
{#
基本模板

#}

<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{% block title %}{% endblock %}</title>

     <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
      <!--Import materialize.css-->
      <link type="text/css" rel="stylesheet" href="{{ url_for('static',filename='material/css/materialize.css') }} "  media="screen,projection"/>

      <!--Let browser know website is optimized for mobile-->
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>

    {% block head %} {% endblock %}

</head>
<body>

   {#上面的导航#}
   {#    通用导航 头#}
   <div class="navbar-fixed">
    <nav>
    <div class="nav-wrapper teal" >
        {#   Logo      #}


{#        全局导航 #}
        <ul class="left">

            <li><a href="/report/">报告管理({{ report_count }})</a></li>
            <li><a href="/admin/">数据管理({{ record_count }})</a></li>
        </ul>


        <a href="#" class="brand-logo center" >{% block navtitle %}Logo{% endblock %}</a>
{#        <ul class="left hide-on-med-and-down">#}
{#            <li></li>#}
{#            <li><a>首页</a></li>#}
{#        </ul>#}
        <ul class="right">
{#            <li><a>其他</a></li>#}
{#        导航菜单，子页面需要继承添加自定义的项的话#}
            {% block navmenu %}
{#                自定义的选项 #}
            {% endblock %}

{#        用户下拉  #}
        <a class="btn dropdown-trigger" id="user_dropdown" data-target="dropdown_user">{{ current_user.id }}</a>
        <ul class="dropdown-content" id="dropdown_user">
            <li><a  href="{{ url_for('user.logout') }}" href="#!">退出登录</a></li>
        </ul>

        </ul>
    </div>
    </nav>
</div>

{#    对于不想70%居中的，就重写body段#}
   {% block body %}
   {% endblock %}
    <div class="container" >



        {% block container %}

        {% endblock %}


{#    添加一个全局的错误模态提示框 ,子页面可以直接调用#}


    <div class="modal modal-fixed-footer" id="base-modal">

        <div class="modal-content">
            <h4 id="base-modal-title"></h4>
            <p id="base-modal-content"></p>
        </div>
        <div class="modal-footer">
            <a class="btn waves-red modal-close">关闭</a>
        </div>

    </div>

{#    一个全局的 yes or no 对话框#}

    <div class="modal modal-fixed-footer" id="confirm-modal">
        <div class="modal-content">
            <h4 id="confirm-title"></h4>
            <div id="confirm-content"></div>
        </div>
        <div class="modal-footer">
            <a class="btn modal-close" id="confirm-yes" >确定</a>
            <a class="btn modal-close">取消</a>
        </div>
    </div>

{#-----------------------模态框结束-------------#}
    </div>


    <script type="text/javascript" src="{{ url_for('static',filename='js/jquery.min.js') }}"></script>
    <script type="text/javascript" src="{{ url_for('static',filename='js/vue.js') }}"></script>
    <script type="text/javascript" src="{{ url_for('static',filename='material/js/materialize.js') }}"></script>
    <script type="text/javascript" src="{{ url_for('static',filename='base.js') }}"></script>

    <script>
{#        初始化通用模态框 #}

        var base_modal = M.Modal.init(document.getElementById('base-modal'));
        M.Dropdown.init(document.getElementById('user_dropdown'));

    {#    调用函数#}
        function showDialog(title,content) {
            $('#base-modal-title').html(title);
            $('#base-modal-content').html(content);
            base_modal.open();

        }
        {#输出json结果 ， 结果格式通用是返回 {code:xx,data:xx} 这种形式，code==0表示成功的，弹一个toast即可,不是一的显示对话框#}
        function showJsonResult(data,title)
        {
            if(title===undefined)title='异常';
            if(data.code!==0)
            {
                showDialog(title,data.data);
            }
            else
                M.toast({html:data.data})
        }

        var zsDialog = new ZsDialog();


        //请求用户和记录信息
        $.ajax(
            {
                url:''
            }
        );
    </script>

{% block script %}
{% endblock %}

</body>
</html>